package com.net.oil.car.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.car.bean.CarSeriesBean;
import com.net.oil.car.bean.CarTypeBean;
import com.net.oil.car.contract.CarSeriesContract;
import com.net.oil.car.model.CarSeriesModel;

import java.util.List;

/**
 * 作者：lch
 * 时间：2018/4/9 0009:下午 15:27
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class CarSeriesPresenter extends BasePresenter<CarSeriesContract.View> implements CarSeriesContract.Presenter {

    private CarSeriesContract.View view;
    private CarSeriesContract.Model model;

    public CarSeriesPresenter(CarSeriesContract.View view) {
        this.view = view;
        model = new CarSeriesModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getCarSeriesList(int brandId) {
        model.getCarSeriesList(brandId);
    }

    @Override
    public void getCarSeriesListSuccess(List<CarSeriesBean> carSeriesBeans) {
        view.getCarSeriesListSuccess(carSeriesBeans);
    }

    @Override
    public void getCarSeriesListFailed() {
        view.getCarSeriesListFailed();
    }

    @Override
    public void getCarTypeList(int carSysId) {
        model.getCarTypeList(carSysId);
    }

    @Override
    public void getCarTypeListSuccess(List<CarTypeBean> carTypeBeans) {
        view.getCarTypeListSuccess(carTypeBeans);
    }

    @Override
    public void getCarTypeListFailed() {
        view.getCarTypeListFailed();
    }
}
